package com.controller;

import com.alibaba.fastjson.JSON;
import com.entity.UserEntity;
import com.service.UserService;
import com.service.serviceImpl.UserServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;
@WebServlet("/app/test")
public class testServlet extends HttpServlet {
    private UserService userService = new UserServiceImpl();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        List<UserEntity> stringObjectMap = userService.testUserJoinPost();
        String JSONMap = JSON.toJSONString(stringObjectMap);
        System.out.println(stringObjectMap);
        System.out.println("=========");
        System.out.println(JSONMap);
        resp.getWriter().write(JSONMap);
    }
}
